﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using NorthwindDataservice;

namespace NorthwindWebservice.Controllers
{
    [Route("api/categories")]
    public class CategoriesController : Controller
    {
        DataService _dataService;

        public CategoriesController(DataService dataService)
        {
            _dataService = dataService;
        }

        public IActionResult Index()
        {
            var categories = _dataService.GetCategories();
            return Ok(categories);
        }
    }
}